<template>
  <!-- 监测点分类 -->
  <div class="FlClassify">
    <!-- 搜索框-->
    <el-tabs v-model="activeName">
      <el-tab-pane label="实时监测" name="1">
        <PresMoni @toReal="toreal"/>
      </el-tab-pane>
      <el-tab-pane label="实时数据" name="2">
        <RealTime :moniId="moniId"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
//引入组件
import RealTime from "./realTime/index";
import PresMoni from "./presMoni/index";
export default {
  components: {
    RealTime,
    PresMoni
  },
  data () {
    return {
      activeName: "1",
      moniId: "",
      monipointName: ""
    }
  },
  mounted () {
    if (this.$route.query.id) {
      this.moniId = this.$route.query.id
    }
    if (this.$route.query.active) {
      this.activeName = this.$route.query.active
    } 
  },
  methods: {
    toship (id, name) {
      this.activeName = "2"
      this.monipointId = id
      this.monipointName = name
    },
    toreal (id) {
      this.moniId = id
      this.activeName = "2"
    }
  },
};
</script>

<style lang="scss" scoped>
.FlClassify {
  // padding: 20px 30px 0 30px;
  // background: #f2f3f5;
}
</style>
